package com.example.tanwei.mapper;

import com.example.tanwei.pojo.User;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @Author: huang
 */
@Component
@Mapper
public interface UserMapper {

    @Select("select * from user ")
    public List<User> getUsers();

    @Select("select * from user where id=#{id}  ")
    public User getUserById(@Param("id") int id);

    @Insert("insert into user(username,password,create_time) values(#{username},#{password},#{create_time}) ")
    int addUser(User user);

    @Delete("delete from user where id=#{id}")
    int deleteUserById(int id);
}
